package com.artqiyi.dollmachine.views.widget.dialog;

import android.app.Activity;
import android.content.Context;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.artqiyi.dollmachine.R;
import com.artqiyi.dollmachine.views.adapter.OperateDetailPageAdapter;
import com.artqiyi.dollmachine.views.fragment.OperateCatchRecordFragment;
import com.artqiyi.dollmachine.views.fragment.OperateDetailFragment;

import butterknife.Bind;


/**
 * 详情会话
 */
public class RxDialogDetail extends RxDialog {

    TabLayout mTabLayout;
    ViewPager mViewPager;

    private OperateCatchRecordFragment mOperateCatchRecordFragment;

    private OperateDetailFragment mOperateDetailFragment;


    public RxDialogDetail(Context context, View view, int themeResId) {
        super(context, themeResId);
        mContext = context;
        initView(view);
    }

    public RxDialogDetail(Context context, View view, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
        mContext = context;
        initView(view);
    }

    public RxDialogDetail(Context context, View view) {
        super(context);
        mContext = context;
        initView(view);
    }

    public RxDialogDetail(Activity context, View view) {
        super(context);
        mContext = context;
        initView(view);
    }

    public RxDialogDetail(Context context, View view, float alpha, int gravity) {
        super(context, alpha, gravity);
        mContext = context;
        initView(view);
    }

    private void initView(View view) {
//        View dialog_view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_detail, null);
//        mTabLayout = (TabLayout) dialog_view.findViewById(R.id.layout_showcase);
//        mViewPager = (ViewPager) dialog_view.findViewById(R.id.pager_showcase);
//        String[] title = {mContext.getString(R.string.operate_detail), mContext.getString(R.string.operate_catch_record)};
//
//        mOperateDetailFragment = new OperateDetailFragment();
//        mOperateCatchRecordFragment = new OperateCatchRecordFragment();
//        Fragment[] fragments = {mOperateDetailFragment, mOperateCatchRecordFragment};
//
//        OperateDetailPageAdapter adapter = new OperateDetailPageAdapter(getChildFragmentManager(), fragments, title);
////        OperateDetailPageAdapter adapter = new OperateDetailPageAdapter(((AppCompatActivity)mContext).getSupportFragmentManager(), fragments, title);
//        mViewPager.setAdapter(adapter);
//        mViewPager.setOffscreenPageLimit(title.length);
//        mTabLayout.setTabMode(TabLayout.MODE_FIXED);
//        mTabLayout.setupWithViewPager(mViewPager);
        setContentView(view);
        setCanceledOnTouchOutside(false);
    }

}
